<template>
  <div class="tag">
    <block v-for="(item,index) in list" :key="index">
      <view class="tag-view" :class="item.className" v-if="item.isShow"><text>{{item.name}}</text></view>
    </block>
  </div>
</template>

<script>
import {getUserBirthdayAge} from '@/common/util'
export default {
  name : 'tag-con' ,
  data(){
    return {
      list:[],//标签数据
    }
  },
  mounted(){
    this.getUnserInfoList()
  },
  computed:{
  },
  methods:{
    getUnserInfoList(){
      const data = this.$store.state.userInfo
      let userBirthday=false
      const token = uni.getStorageSync('token')
      if(token){
        userBirthday = getUserBirthdayAge(data.userBirthday)
      }
      this.list = [ {name:'红十字会会员',className:'FC1C1C',isShow:data.isGhMember},
        {name:'工会会员',className:'d162DFF',isShow:data.isGhMember},
        {name:'残障人士',className:'d1FC9FF',isShow:data.isClMember},
        {name:'商会会员',className:'FB4CFF',isShow:data.isShMember},
        {name:'青年',className:'d3CC934',isShow:userBirthday},
        {name:'妇女',className:'FF5F82',isShow:data.userSex==='2'},]
    }
  }
}
</script>

<style scoped lang="scss">
@import "./index";
</style>
